package com.nongfuspring.nongfu.serviceImpl;

import com.nongfuspring.nongfu.mapper.HujiMapper;
import com.nongfuspring.nongfu.mapper.UserMapper;
import com.nongfuspring.nongfu.pojo.Huji;
import com.nongfuspring.nongfu.pojo.Transfer;
import com.nongfuspring.nongfu.pojo.UserHuji;
import com.nongfuspring.nongfu.service.HujiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;

/**
 * @author ：huad.xu
 * @date ：Created in 2022/4/4 21:19
 * @description：
 * @modified By：
 * @version: $
 */
@Service
public class HujiServiceImpl implements HujiService {
    @Autowired
    HujiMapper hujiMapper;

    @Autowired
    UserMapper userMapper;
    @Override
    public Integer addHuji(Huji huji) {
        return hujiMapper.addHuji(huji);
    }

    @Override
    public ArrayList<Huji> queryHujiList(Huji huji) {
        return hujiMapper.queryHujiList(huji);
    }

    @Override
    public Integer addUserToHuji(Transfer transfer) {
        return hujiMapper.addUserToHuji(transfer);
    }

    @Override
    public Integer countHomeId(Integer homeId) {
        return hujiMapper.countHomeId(homeId);
    }

    @Override
    public ArrayList<UserHuji> queryhujidetail(Integer homeId) {
        return hujiMapper.queryhujidetail(homeId);
    }

    @Override
    public Integer queryUserBynUmber(String username, String usernumber) {
        return userMapper.queryUserBynUmber(username,usernumber);
    }

    @Override
    public Integer removeUserOfHuji(String username, String usernumber) {
        return hujiMapper.removeUserOfHuji(username,usernumber);
    }


}
